package Luogu;

import java.util.Scanner;

public class test6 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int prev = sc.nextInt();
        System.out.println("prev"+prev);
        int next = 0;
        int count = 1;
        int max = 1;
        for (int i = 1; i < n; i++) {
            next = sc.nextInt();
            System.out.println("next"+next);
            if ((next - prev) == 1) {
                count++;
            }
            else
                {
                if (count > max) {
                    max = count;
                }
                count = 1;
            }
            prev = next;
        }

        System.out.println(max);
    }
}
